﻿<UserControl x:Class="BillsManager.Views.SettingsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Loc="clr-namespace:BillsManager.Localization;assembly=BillsManager.Localization"
             xmlns:ViewModel="clr-namespace:BillsManager.ViewModels;assembly=BillsManager.ViewModels"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             d:DataContext="{Binding Source={d:DesignInstance Type=ViewModel:SettingsViewModel,
                                                              IsDesignTimeCreatable=True}}"
             mc:Ignorable="d">

    <UserControl.Resources>
        <!--<ResourceDictionary Source="Dictionaries\Styles.xaml" />-->
        <ResourceDictionary Source="Themes\Themes.xaml" />
    </UserControl.Resources>

    <UserControl.Background>
        <Binding Mode="OneTime" Source="{StaticResource View.Background}" />
    </UserControl.Background>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="{StaticResource View.MarginSize}" />
            <RowDefinition />
            <RowDefinition Height="{StaticResource View.MarginSize}" />
            <!--<RowDefinition />
            <RowDefinition Height="{StaticResource View.MarginSize}" />-->
            <RowDefinition />
            <RowDefinition Height="{StaticResource View.Region.Spacing.Medium}" />
            <RowDefinition />
            <RowDefinition Height="{StaticResource View.MarginSize}" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="{StaticResource View.MarginSize}" />
            <ColumnDefinition MinWidth="75" />
            <ColumnDefinition Width="{StaticResource View.MarginSize}" />
            <ColumnDefinition MinWidth="150" />
            <ColumnDefinition Width="{StaticResource View.MarginSize}" />
        </Grid.ColumnDefinitions>

        <TextBlock Grid.Row="1"
                   Grid.Column="1"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Top"
                   Text="{Loc:Translate Language}" />

        <ComboBox Grid.Row="1"
                  Grid.Column="3"
                  HorizontalAlignment="Stretch"
                  VerticalAlignment="Center"
                  ItemsSource="{Binding AvailableLanguages}"
                  SelectedItem="{Binding CurrentLanguage}">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock>
                        <Run Text="{Binding NativeName, Mode=OneTime}" />
                    </TextBlock>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>

        <TextBlock Grid.Row="3"
                   Grid.Column="1"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Top"
                   Text="{Loc:Translate ConnectAutomatically}" />

        <CheckBox Grid.Row="3"
                  Grid.Column="3"
                  HorizontalAlignment="Left"
                  VerticalAlignment="Center"
                  IsChecked="{Binding StartupDBLoad}" />

        <StackPanel Grid.Row="5"
                    Grid.Column="1"
                    Grid.ColumnSpan="3"
                    HorizontalAlignment="Right"
                    Orientation="Horizontal">
            <Button MinWidth="80"
                    Command="{Binding SaveAndCloseCommand,
                                      Mode=OneTime}"
                    Content="{Loc:Translate Save}">
                <Button.Margin>
                    <Thickness Right="{StaticResource View.MarginSize.Value}" />
                </Button.Margin>
            </Button>
            <Button MinWidth="80"
                    Command="{Binding CancelAndCloseCommand,
                                      Mode=OneTime}"
                    Content="{Loc:Translate Cancel}" />
        </StackPanel>

        <!--<TextBlock Grid.Row="5"
                   Grid.Column="1"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Top"
                   Text="{Loc:Translate FeedbackAddressee}" />

        <TextBox Grid.Row="5"
                 Grid.Column="3"
                 HorizontalAlignment="Stretch"
                 VerticalAlignment="Center"
                 Text="{Binding FeedbackToEmailAddress}" />-->

    </Grid>
</UserControl>